var auth = require('../config/auth');
var controllers = require('../controllers/index');

module.exports = function (app) {
    app.post('/login', auth.login);
    app.get('/logout', auth.logout);
    app.get('/checkLogin', auth.isLogin);


    app.post('/addUser', controllers.user.addUser);

    app.post('/addStation', controllers.station.addStation);
    app.post('/deleteStation', controllers.station.deleteStation);
    app.get('/getStationInfo',controllers.station.getStationInfo);
    app.get('/getAllStationInfo',controllers.station.getAllStationInfo);
    app.post('/updateStation', controllers.station.updateStation);

    app.post('/addLabel', controllers.label.addLabel);
    app.post('/deleteLabel', controllers.label.deleteLabel);
    app.get('/getAllLabelInfo', controllers.label.getAllLabelInfo);
    app.post('/updateLabel', controllers.label.updateLabel);

    app.get('/getStationHistoryInfo',controllers.historyData.getStationHistoryInfo);
    app.get('/getLabelHistoryInfo',controllers.historyData.getLabelHistoryInfo);
    app.get('/createHistoryData',controllers.historyData.createHistoryData);
    app.get('/getAllHistoryInfo',controllers.historyData.getAllHistoryInfo);
    app.get('/getHistoryDataFile',controllers.historyData.getHistoryDataFile);

    // app.post('/addConfig',controllers.config.addConfig);
    app.get('/getConfigInfo',controllers.station.getConfigInfo);

    app.post('/addArea',controllers.area.addArea);
    app.get('/getAllArea',controllers.area.getAllArea);
    app.post('/updateArea',controllers.area.updateArea);
    app.post('/deleteArea',controllers.area.deleteArea);
};